package com.prd.controller;


import com.prd.service.OaRewardsAndPunishmentsService;
import com.prd.util.JsonData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 人事奖惩管理数据表 前端控制器
 * </p>
 *
 * @author lizhaoyi
 * @since 2024-01-29
 */
@RestController
@RequestMapping("/api/oaRewardsAndPunishments")
@Api(tags = "奖惩管理")
public class OaRewardsAndPunishmentsController {


    @Autowired
    private OaRewardsAndPunishmentsService rewardsAndPunishmentsService;

    @ApiOperation("获取奖惩列表")
    @GetMapping
    public JsonData getList(){

        return rewardsAndPunishmentsService.getList();
    }

    @ApiOperation("获取奖惩分页列表")
    @GetMapping("page")
    public JsonData getPage(@RequestParam("status") @ApiParam("状态") Integer status,
                            @RequestParam("type") @ApiParam("类型") Integer type,
                            @RequestParam("size") @ApiParam("类型") Integer size,
                            @RequestParam("page") @ApiParam("类型") Integer page){

        return rewardsAndPunishmentsService.getPage(status,type,size,page);
    }

    @ApiOperation("根据id获取奖惩详情")
    @GetMapping("/{id}")
    public JsonData getDetailById(@PathVariable("id") Long id){

        return rewardsAndPunishmentsService.getDetailById(id);
    }


    @ApiOperation("确认发布")
    public JsonData apply(){

        //TODO 待确认需求

        return null;
    }

    @ApiOperation("获取流程记录")
    public JsonData getProcess(){

        //TODO 待确认需求

        return null;
    }




}

